<!DOCTYPE html>
<html lang="en" xmlns:th="http://www.thymeleaf.org">
<head th:replace="~{commons/common::head(~{::title})}">
    <title>归档</title>
</head>
<body>
<!--导航栏 menu-->
<div th:replace="~{commons/common::menu(activeUrl = 'archives.html')}"></div>

<!--中间部分-->
<div class="m-container-small m-padded-tb-big">
    <div class="ui container">
        <!--header-->
        <div class="ui top middle aligned attached segment padded">
            <div class="ui  two column grid">
                <div class="column">
                    <h3 class="ui blue header">归档</h3>
                </div>
                <div class="right aligned column">
                    共 <h2 class="ui teal header m-inline-block m-text-thin" th:text="${blogCount}">200</h2> 篇博客
                </div>
            </div>
        </div>

      <th:block th:each="entry : ${archiveMap}">
          <!--显示年份-->
          <h2 class="ui center aligned header" th:text="| ${entry.key} 年 |">2022</h2>

          <!--该年份下的博客-->
          <div class="ui fluid vertical menu">

              <a th:href="@{/article/} + ${blog.id}" target="_blank" class="item" th:each="blog : ${entry.value}">
               <span>
                    <i class="mini green circle icon"></i> &nbsp;<span th:text="${blog.title}"></span>
                   <div class="ui green basic left pointing label" th:text="${#dates.format(blog.createTime, 'MMMdd')}">3月4号</div>
               </span>
                  <div class="ui orange basic left pointing label" th:text="${blog.flag}">随笔</div>
              </a>

          </div>

      </th:block>

    </div>
</div>

<br>

<!--底部 footer-->
<div th:replace="~{commons/common::footer}"></div>

<!-- 引用的 js-->
<th:block th:replace="~{commons/common::script}">
</th:block>

<script>
    // 在手机端点击汉堡按钮，重新显示隐藏的导航栏内容
    $('.menu.toggle').click(function () {
        $('.m-item').toggleClass('m-mobile-hidden');
    });


    // 搜索框弹出消息
    $('.m-popup input').popup({
        on: 'focus',
        position: 'bottom center'
    });

</script>
</body>
</html>